<?php
include("../inc/global.inc");
if($_GET[act_tj]){
if($_SESSION['code']!=$_POST["c_code"]){
	echo"<script>alert('您的验证码错误');location='javascript:history.go(-1)';</script>";exit;
	}else{
		if($_POST["to_id"]<0)
		{
			echo"<script>alert('未知会员！');location='JavaScript:history.go(-1)';</script>";exit;
		}
	   mysql_query("insert into m_message (member_id,m_subject,m_web,m_content,m_name,m_tel,m_email,m_qq,m_addr,add_time,ip) values ('".$_POST['to_id']."','$_POST[inquire_subject]','$_POST[url]','$_POST[inquire_content]','$_POST[inquire_name]','$_POST[inquire_tel]','$_POST[inquire_email]','$_POST[inquire_qq]','$_POST[inquire_addr]','".date("Y-m-d,H:i:s")."','".ip()."')");
	  
	         $mail_rs=mysql_query("select m_user,m_email,m_phone from member where id='".$_POST['to_id']."'"); 
			 $mail_row=mysql_fetch_array($mail_rs);
			
			//发送短信
			
			

	  $_tel = $mail_row['m_phone'];
				 $_title="三帝招聘网提示：您有一条应聘留言,请登陆会员助手查看,job.sandib2b.cn";
				 sendtel($_tel,$_title);
		
		
					 $content=iconv("utf-8","gb2312","<HTML>
<HEAD>
<TITLE>邮件来自三帝招聘网</TITLE>
<style type='text/css'>
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	font-size: 12px;
	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
	background-color: #FFFFFF;
}
a:link {
	color: #003399;
	text-decoration: underline;
}
a:hover {
	color: #FF6600;
	text-decoration: underline;
}
a:active {
	color: #003399;
	text-decoration: underline;
}
a:visited {
	color: #003399;
	text-decoration: underline;
}



#mail {
	padding: 0px;
	width: 622px;
	margin-top: 0px;
	margin-right: auto;
	margin-bottom: 0px;
	margin-left: auto;
	border-right-width: 1px;
	border-left-width: 1px;
	border-right-style: solid;
	border-left-style: solid;
	border-right-color: #ECE9D8;
	border-left-color: #ECE9D8;
}
#mail .info .to {
	line-height: 22px;
}

#mail .info .title {
	font-family: Arial;
	font-size: 19px;
	padding: 5px;
	background-color: #EBEBEB;
}

#mail .logo {
	float: left;
	padding-top: 13px;
}
#mail .headbg {
	float: right;
}
#mail .info {
	padding: 10px;
}
#mail .info .note {
	background-color: #ECF3FB;
	padding: 5px;
	line-height: 18px;
}

#mail .foot {
	background-color: #7EB1DA;
	padding: 6px;
	text-align: right;
}

.onl {
	clear: both;
}
-->
</style>
</HEAD>
<BODY>
<div id='mail'>
<div class='logo'><img src='http://www.sandib2b.cn/images/logo.gif' width='388' height='60'></div>
<div class='headbg'><img src='http://www.sandib2b.cn/images/headbg.gif' width='220' height='75'></div>
<div class='onl'></div>
<table width='100%' border='0' cellpadding='0' cellspacing='0'>
  <tr>
    <td height='42' align='right' valign='bottom' background='http://www.sandib2b.cn/images/webbg.gif'><img src='http://www.sandib2b.cn/images/messbg.gif' width='257' height='28'></td>
    </tr>
</table>
<div class='info'>
  <table cellspacing='0' cellpadding='0' width='100%' align='center' border='0'>
    <tbody>
      <tr>
        <td width='593' height='300' valign='top'><div><strong>您好,"."$mail_row[m_user]"."</strong><div class='to'></div>
          <div class='title'>应聘邮件</div>
          <table border='0' align='center' cellpadding='2' cellspacing='1' bgcolor='#FFFFFF'>
                  <tbody>
                    <tr>
                      <th width='123' height='25'>主题</th>
                      <td width='459' height='25'>三帝招聘网-应聘邮件</td>
                    </tr>
                    <tr bgcolor='#f7f7f7'>
                      <th>详细内容</th>
                      <td height='100' valign='top'>您有一封新的应聘邮件</td>
                    </tr>
					<tr bgcolor='#f7f7f7'>
                      <th height='35'>会员登陆</th>
                      <td><a href='http://job.sandib2b.cn/'>http://job.sandib2b.cn/</a></td>
                    </tr>
					<tr bgcolor='#f7f7f7'>
                      <th height='35'></th>
                      <td>提示：系统邮件请勿回复！</td>
                    </tr>
                  </tbody>
              </table>
          </div>
          </td>
      </tr>
    </tbody>
  </table>
</div>
<div class='foot'>求职招聘上三帝招聘网</div>
</div>
</BODY>
</HTML>");
                     $tomail=$mail_row['m_email'];
                     $box_title= iconv("utf-8","gb2312","应聘邮件来自三帝招聘网");
                    
					 sendmail($tomail,$box_title,$content);
                     //sent email end
	  
	  echo "<script>location='jobsuccess.php';</script>";
	}
	}
?>

<?php
if($_GET[t_type]==2){
   $t_types="留言报价";
}elseif($_GET[t_type]==3){
   $t_types="发送求职意向";
}else{
   $t_types="留言询价";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=$_GET[subject]?>-<?=$t_types?>，三帝招聘网</title>
<link href="/css/body.css" rel="stylesheet" type="text/css" />
<link href="/css/head_2.css" rel="stylesheet" type="text/css" />
<link href="css/message.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php include("../inc/job_top.php")?>
<div class="top1">
<div style="float:left"><?php if($_GET[t_type]==3){?><a href="http://job.sandib2b.cn"><img src="http://job.sandib2b.cn/images/joglogo.gif" alt="三帝招聘网" border="0"/></a><?php }else{?><a href="/"><img src="/images/logo.gif" alt="三帝贸易网" border="0"/></a><?php }?></div>
<div class="top2txt"><?=$t_types?></div>
<div class="onl"></div>
</div>
<div class="onl"></div>
<div id="mian" class="topside6">
<div class="title3 size12"><a href="/">首页</a>&nbsp;&gt;&gt;&nbsp;<?=$t_types?></div>
<div class="content size14">
  <div class="right">
  <table width="100%" border="0" cellpadding="0" cellspacing="3">
	<form name="form1" method="post" action="" onSubmit="return check()">
	  <input name="inquire_subject" type="hidden" value="<?=$_GET[subject]?>">
        <tr>
          <td height="11" align="right" valign="top">留言内容：</td>
          <td height="11"><span class="inquiry-error-wrapper no-error">
            <textarea class="textarea" maxlength="3000" cols="74" wrap="virtual" rows="13" name="inquire_content" style='width:600px'></textarea>
          </span></td>
        </tr>
 <tr>
      <td height="25" align="right">联系人：</td>
      <td><input name="inquire_name" type="text" size="20" maxlength="20" /> <font color="#FF0000">*</font></td>
    </tr>
    <tr>
      <td height="25" align="right">联系电话：&nbsp;</td>
      <td><input name="inquire_tel" type="text" size="20" maxlength="20" /> <font color="#FF0000">*</font></td>
    </tr>
    <tr>
      <td height="25" align="right">邮箱：</td>
      <td><input name="inquire_email" type="text" size="30" maxlength="200" /></td>
    </tr>
    <tr>
      <td height="25" align="right">QQ/MSN：</td>
      <td><input name="inquire_qq" type="text" size="25" maxlength="200" /></td>
    </tr>
    <tr>
      <td height="25" align="right">联系地址：</td>
      <td><input name="inquire_addr" type="text" size="40" maxlength="250" /></td>
    </tr>
        <tr>
          <td height="11" align="right">输入验证码：</td>
          <td height="11"><input name="c_code" id="c_code"  type="text" class="input" maxlength="10" />&nbsp;<img src="../inc/code.php" name="img" width="90" height="30" align="absmiddle" id="img">&nbsp;<a href="#" name="can not see" id="test">刷新</a></td>
        </tr><input type="hidden" name="url" value="<?=$_SERVER['HTTP_REFERER']?>" />
        <tr><input type="hidden" name="act_tj" value="ok" />
          <td height="25">&nbsp;</td><input type="hidden" name="to_id" value="<?=$_GET[to_id]?>">
          <td height="25"><input name="Submit" type="submit" class="button" value=" 发 送 " /></td>
        </tr></form>
      </table>
    
  </div>
<div class="onl"></div>
</div>
<div id="foot" class="footside">
<div class="Copyright">
<ul>
<li><a href="/about/">关于我们</a> | <a href="/about/contact.php">联系我们</a> | <a href="/about/fuwu.php">广告服务</a> | <a href="/about/help.php">帮助中心</a> | <a href="/about/link.php">友情链接</a> | <a href="/about/policy.php">隐私策略</a> | <a href="/about/terms.php">用户协议</a> | <a href="/about/declaration.php">法律声明</a> | <a href="/about/fay.php">付款方式</a></li>
<li>Copyright 2007-2012 © sandib2b.cn 三帝贸易网保留有限权利 All rights reserved.</li>
<li>访问和使用三帝贸易网，即表明您已完全接受和服从我们的<a href="/about/terms.php">用户协议</a>。 皖ICP备08002586号<script src='http://w.cnzz.com/c.php?id=30036614' language='JavaScript' charset='gb2312'></script>
</li>
</ul>
</div>
</div>
</div>
</body>
</html>

<script language="javascript">
function $(id){
return document.getElementById(id);
}
function check(){
if($("inquire_content").value==""){
alert("留言内容不能为空");
$("inquire_content").focus();
return false;
}
if($("inquire_name").value==""){
alert("请留下您的姓名");
$("inquire_name").focus();
return false;
}
if($("inquire_tel").value==""){
alert("请留下您的电话或手机");
$("inquire_tel").focus();
return false;
}


if($("c_code").value==""){
alert("验证码不能为空");
$("c_code").focus();
return false;
}
}

function test(img){
    var src=img.getAttribute("src");
    src=src+"?new="+Math.random(0,10);
    img.setAttribute("src",src);
}
function prepare(){
    var nav=document.getElementById("test");
    var name=nav.getAttribute("name");
    var str="can not see";
    if(name==str){
        nav.onclick=function(){
            var img=document.getElementById("img");
            test(img);
            return false;
        }
    }
}
window.onload=prepare;
</script>
